package com.getsendsocial.GetSendSocial.Util;

import java.util.ArrayList;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.Spinner;

import com.actionbarsherlock.app.SherlockFragment;
import com.getsendsocial.GetSendSocial.R;
import com.getsendsocial.GetSendSocial.Activity.ABSTabsViewPagerActivity;

public class StartTab extends SherlockFragment {
	
	public static int flag = 0;
	  
	 @Override
	 public View onCreateView(LayoutInflater inflater, ViewGroup container,
	   Bundle savedInstanceState) {
	   final LayoutInflater inf = inflater;
	   final View view = inflater.inflate(R.layout.start, null);
	   	   
   	   final Spinner spinner = (Spinner) view.findViewById(R.id.spinnerStart);
   	   ArrayList<String> list = new ArrayList<String>();
   	   list.add("Frasi Simpatiche");
   	   list.add("Frasi Augurali");
   	   
   	   
   	   spinner.setAdapter(new MyAdapterSpinner(ABSTabsViewPagerActivity.c,R.layout.rowspinner2,list,inf));
   	   spinner.setOnItemSelectedListener(new OnItemSelectedListener() {

		@Override
		public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2,
				long arg3) {
				String text = String.valueOf(spinner.getSelectedItem());
				if (text.equals("Frasi Simpatiche")){
					flag=1;
				}
				if (text.equals("Frasi Augurali")){
					flag=2;
				}
		}

		@Override
		public void onNothingSelected(AdapterView<?> arg0) {
			// TODO Auto-generated method stub
			
		}
	});
	   
	 
	  return view;
	 }
	 
	}
